var React = require('react-native');

var {
	StyleSheet,
	Text,
	View,
	ScrollView,
	Image,
	TouchableOpacity,
	ListView,
	ToastAndroid,
	ToolbarAndroid
} = React;

var ProductList = require('./components/ProductList');

module.exports = React.createClass({
	render: function() {
		return (
			<View style={styles.container}>
				<View style={styles.toolbarContainer}>
					<ToolbarAndroid title="商品列表" 
						style={styles.toolbar}
						navIcon={{uri:'ic_action_goback'}}
						onIconClicked={this.goback}>
					</ToolbarAndroid>
				</View>
				<ScrollView style={styles.productContainer}>
					<ProductList/>
				</ScrollView>
			</View>
		)
	},
	goback: function() {
		//ToastAndroid.show('goback', ToastAndroid.SHORT);
		this.props.navigator.pop();
	},
})

var styles = StyleSheet.create({

	container: {
		flex: 1,
		backgroundColor: '#EEE',
	},

	toolbarContainer: {
		flexDirection: 'row',
		height: 55,
		backgroundColor: '#FFF',
		borderBottomWidth: 1,
		borderColor: '#DDD',
	},
	toolbar: {
		flex: 1,
	},
	productContainer: {
		flex: 1,
	}
})